import { Routes, Route } from 'react-router-dom'
import ActiveRank from './pages/active/list'
import ActiveRank2 from './pages/active/list2'
import AddBank from './pages/addBank'
// import CoinItem from "./pages/coin_item";
// import CoinProducts from "./pages/coin_products";
// import ExchangeLog from "./pages/exchange_log";
// import Income from "./pages/income";
// import LevelIntroduction from "./pages/level_introduction";
// import Products from "./pages/products";
// import Recharge from "./pages/recharge";
// import SignInTask from "./pages/signin";
// import VipInfo from "./pages/vipInfo";
// import VipPrivilege from "./pages/vip_privilege";
import { lazy, Suspense, useEffect, useState } from 'react'
import { subPackageConfig } from './utils/util'

const Products = lazy(() => import('./pages/products'))
const CoinProducts = lazy(() => import('./pages/coin_products'))
const CoinItem = lazy(() => import('./pages/coin_item'))
const ExchangeLog = lazy(() => import('./pages/exchange_log'))
const Income = lazy(() => import('./pages/income'))
const LevelIntroduction = lazy(() => import('./pages/level_introduction'))
const LevelDetail = lazy(() => import('./pages/level_introduction/detail'))
const Recharge = lazy(() => import('./pages/recharge'))
const RechargeV2 = lazy(() => import('./pages/recharge/index_v2'))
const SignInTask = lazy(() => import('./pages/signin'))
// const VipInfo = lazy(() => import('./pages/vipInfo'));
const VipPrivilege = lazy(() => import('./pages/vip_privilege'))
const Result = lazy(() => import('./pages/result'))
const RecordList = lazy(() => import('./pages/record_list'))
const CoinLottery = lazy(() => import('./pages/active/coin_lottery'))
const CoinLottery2 = lazy(() => import('./pages/active/coin_lottery2'))
const Protocol = lazy(() => import('./pages/protocol'))
const H5Recharge = lazy(() => import('./pages/h5_recharge'))
const UnionIncome = lazy(() => import('./pages/union/income'))
const UnionWithdraw = lazy(() => import('./pages/union/withdraw'))
const UnionDetail = lazy(() => import('./pages/union/detail'))
const UnionIncomeDetail = lazy(() => import('./pages/union/income_detail'))
const BankManagement = lazy(() => import('./pages/bank_management'))

const DuanwuLottery = lazy(() => import('./pages/active/dragon_boat_lottery'))
const BoatTask = lazy(() => import('./pages/active/dragon_boat_task'))

const AddAli = lazy(() => import('./pages/addBank/add_ali'))
const PersonList = lazy(() => import('./pages/bank_management/person_list'))
const Valentine = lazy(() => import('./pages/active/valentine'))
const ValentineProduct = lazy(() => import('./pages/active/valentine/product'))
const ValentineRank = lazy(() => import('./pages/active/valentine_rank'))
const ValentineRecord = lazy(() => import('./pages/active/valentine/record'))
const Lots = lazy(() => import('./pages/active/lots'))
const Airplane = lazy(() => import('./pages/active/airplane'))
const Ferris = lazy(() => import('./pages/active/ferris_wheel'))
const Zodiac = lazy(() => import('./pages/active/save_zodiac'))
const RankYear = lazy(() => import('./pages/active/rank_year'))
const VipCenter = lazy(() => import('./pages/vip_center'))
const VipCenterDetail = lazy(() => import('./pages/vip_center/detail'))

const Download = lazy(() => import('./pages/download'))

function App() {
  const [config, setConfig] = useState({ package_key: '' })

  useEffect(() => {
    setConfig(subPackageConfig())
  }, [])

  return (
    // ymeng ameng
    <div className="App" id={config.package_key}>
      <Suspense>
        <Routes>
          <Route path="/product" element={<Products />}></Route>
          <Route path="/coin_product" element={<CoinProducts />}></Route>
          <Route path="/coin_detail" element={<CoinItem />}></Route>
          <Route path="/exchange_log" element={<ExchangeLog />}></Route>
          <Route path="/income" element={<Income />}></Route>
          <Route path="/add_bank" element={<AddBank />}></Route>
          <Route path="/recharge" element={<Recharge />}></Route>
          <Route path="/recharge_v2" element={<RechargeV2 />}></Route>
          <Route path="/vip_info" element={<VipCenter />}></Route>
          <Route path="/signin" element={<SignInTask />}></Route>
          <Route path="/privilege" element={<VipPrivilege />}></Route>
          <Route path="/level_introduction" element={<LevelIntroduction />}></Route>
          <Route path="/level_detail" element={<LevelDetail />}></Route>
          <Route path="/active_rank" element={<ActiveRank />}></Route>
          <Route path="/active_rank2" element={<ActiveRank2 />}></Route>
          <Route path="/result" element={<Result />}></Route>
          <Route path="/record_list" element={<RecordList />}></Route>
          {/* <Route path="/record_list" element={<RecordList />}></Route> */}
          <Route path="/coin_lottery" element={<CoinLottery />}></Route>
          <Route path="/coin_lottery2" element={<CoinLottery2 />}></Route>
          <Route path="/protocol" element={<Protocol />}></Route>
          <Route path="/union_income" element={<UnionIncome />}></Route>
          <Route path="/union_withdraw" element={<UnionWithdraw />}></Route>
          <Route path="/union_detail" element={<UnionDetail />}></Route>
          <Route path="/union_income_detail" element={<UnionIncomeDetail />}></Route>
          <Route path="/dragon_boat_lottery" element={<DuanwuLottery />}></Route>
          <Route path="/dragon_boat_task" element={<BoatTask />}></Route>
          <Route path="/bank_management" element={<BankManagement />}></Route>
          <Route path="/add_ali" element={<AddAli />}></Route>
          <Route path="/person_list" element={<PersonList />}></Route>
          <Route path="/valentine" element={<Valentine />}></Route>
          <Route path="/valentine/product" element={<ValentineProduct />}></Route>
          <Route path="/valentine/rank" element={<ValentineRank />}></Route>
          <Route path="/valentine/record" element={<ValentineRecord />}></Route>
          <Route path="/h5_recharge" element={<H5Recharge />}></Route>
          <Route path="/" element={<H5Recharge />}></Route>
          <Route path="/download" element={<Download />}></Route>
          <Route path="/lots" element={<Lots />}></Route>
          <Route path="/airplane" element={<Airplane />}></Route>
          <Route path="/ferris" element={<Ferris />}></Route>
          <Route path="/save_zodiac" element={<Zodiac />}></Route>
          <Route path="/vip_center" element={<VipCenter />}></Route>
          <Route path="/vip_center_detail" element={<VipCenterDetail />}></Route>
          <Route path="/rank_year" element={<RankYear />}></Route>
        </Routes>
      </Suspense>
    </div>
  )
}

export default App
